package com.sxz.sbs.module.client.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.client.bean.CallRecordsBean;
import com.sxz.sbs.module.client.bean.DealRecordBean;
import com.sxz.sbs.module.client.view.CallRecordsView;
import com.sxz.sbs.module.client.view.DealRecordView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;
import java.util.List;

/**
 * 交易记录
 */
public class DealRecordPresenter extends RxPresenter<DealRecordView>{
    /**
     * @param map
     */
    public void getPlanList(final HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getPlanList(map)
                .compose(RxUtil.<DealRecordBean>handleResult())
                .subscribeWith(new RxSubscriber<DealRecordBean>(mView){
                    @Override
                    public void onNext(DealRecordBean data) {
                        mView.onPlanListSuccess(data);
                    }
                })
        );
    }
}
